#include "stdio.h"
#include "stdlib.h"
#include "../intLinkStack.c"
int pureRecursionFact(int n){
    if(n==1||n==0)return 1;
    else return n*pureRecursionFact(n-1);
}
int StackSteadFact(int n){
    int t=n,r;
    LinkStack s=NULL;
    while(t>1){
        s=Push_LinkStack(s,t);
        t--;
    }
    r=1;
    while(!Empty_LinkStack(s)){
        s=Pop_LinkStack(s,&t);
        r=r*t;
    }
    return r;
}
int main(int argc,char const *argv[]){
    printf("%d!=%d\n",5,pureRecursionFact(5));
    printf("%d!=%d\n", 5, StackSteadFact(5));
    getchar();
    return 0;
}